package com.hhit.yb.compose_demo.views.basic

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.hhit.yb.compose_demo.models.places
import com.hhit.yb.compose_demo.models.snacks
import com.hhit.yb.compose_demo.ui.theme.backgroundColor
import com.hhit.yb.compose_demo.views.PlaceCard
import com.hhit.yb.compose_demo.views.PlacesToBookComponent

@Composable
fun Tutorial2_5Screen3() {
    LazyColumn(
        contentPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp),
        verticalArrangement = Arrangement.SpaceEvenly,
        modifier = Modifier
            .fillMaxHeight()
            .background(backgroundColor)
    ) {

        item {
            Text(
                color = Color(0xffE53935),
                fontSize = 24.sp,
                fontWeight = FontWeight.Bold,
                text = "Snacks"
            )
        }

        item {
            LazyRow(
                horizontalArrangement = Arrangement.spacedBy(8.dp),
                content = {
                    items(snacks.size) {
                        HorizontalSnackCard(snack = snacks[it])
                    }
                }
            )
        }

        item {
            Text(
                color = Color(0xff4CAF50),
                fontSize = 24.sp,
                fontWeight = FontWeight.Bold,
                text = "Places"
            )
        }

        item {
            LazyRow(
                horizontalArrangement = Arrangement.spacedBy(8.dp),
                content = {
                    items(places.size) {
                        PlaceCard(place = places[it])
                    }
                }
            )
        }

        item {
            Text(
                color = Color(0xff4CAF50),
                fontSize = 24.sp,
                fontWeight = FontWeight.Bold,
                text = "Places to Visit"
            )
        }

        item {
            LazyRow(
                horizontalArrangement = Arrangement.spacedBy(8.dp),
                content = {
                    items(places.size) {
                        PlacesToBookComponent(place = places[it])
                    }
                }
            )
        }
    }
}